<!--
  * 公司 详情
  * 
  * @Author:    1024创新实验室-主任：卓大 
  * @Date:      2022-08-15 20:15:49
  * @Wechat:    zhuda1024 
  * @Email:     lab1024@163.com 
  * @Copyright  1024创新实验室 （ https://1024lab.net ），Since 2012 
-->
<template>
  <div class="detail-header">

  </div>
  <!---------- 表格 begin ----------->
  <a-table
      size="small"
      :dataSource="tableData"
      :columns="columns"
      rowKey="id"
      bordered
      :loading="tableLoading"
      :pagination="false"
  >
  </a-table>
  <!---------- 表格 end ----------->
</template>

<script setup>
import { computed, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import { smartSentry } from '/@/lib/smart-sentry';
import {rolandOrderApi} from "/@/api/business/roland-order/roland-order-api";

const columns = ref([
  {
    title: '楼层',
    dataIndex: 'floor',
    ellipsis: true,
  },
  {
    title: '排号',
    dataIndex: 'seatRow',
    ellipsis: true,
  },
  {
    title: '座位号',
    dataIndex: 'seatNo',
    ellipsis: true,
  },
  {
    title: '位置',
    dataIndex: 'positionStr',
    ellipsis: true,
  },
]);

  const route = useRoute();
let orderId = ref();
  onMounted(() => {
    if (route.query.orderId) {
      orderId.value = Number(route.query.orderId);
      getDetail();
    }
  });


// 表格加载loading
const tableLoading = ref(false);
// 表格数据
const tableData = ref([]);

  async function getDetail() {
    tableLoading.value = true;
    try {
      let result = await rolandOrderApi.detail(orderId.value);
      tableData.value = result.data;
    } catch (e) {
      smartSentry.captureError(e);
    } finally {
      tableLoading.value = false;
    }
  }

</script>

<style lang="less" scoped>
  .detail-header {
    background-color: #fff;
    padding: 10px;
  }
</style>
